<?php

    date_default_timezone_set('Europe/Moscow');

    $host = isset($_SERVER["SERVER_NAME"]) ? $_SERVER["SERVER_NAME"] : '';
    $port = isset($_SERVER["SERVER_PORT"]) ? $_SERVER["SERVER_PORT"] : '';
    $port = $port == '80' || $port == '8080' ? '' : ":$port";
    $protocol = (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == 'on' ? "https" : "http");

    $rootPath = dirname(__FILE__). '/../';
    $rootPath = str_replace('\\', '/', $rootPath);
    $rootPath = preg_replace('|/[^/]+?/\.\./|', '/', $rootPath);
    $siteUrl = "{$protocol}://{$host}/";

    define("ROOT_PATH",   $rootPath);

    unset( $host, $port, $protocol, $rootPath, $siteUrl );

    define("CACHE_DIR",                 ROOT_PATH. "cache/");
    define('CLASSES_DIR',               ROOT_PATH. 'classes/');


    define('MAIL_HOST', 'mail.ispringsolutions.com');
    define('MAIL_PORT', '25');
    define('MAIL_USERNAME', 'support@ispringsolutions.com');
    define('MAIL_PASS', 'mask1ben');
    define('MAIL_SMTP_SECURE', 'tls');
    define('MAIL_FROM_NAME', 'info@institutps.ru');

    define('REQUEST_MAIL_BODY_TPL', ROOT_PATH . 'templates/mail/request_mail.tpl');
    define('MAIL_SUBJECT', 'Заявка на обучение от %NAME%');
    define('REQUEST_MAIL_BOX', 'sergey.shadrin@cpslabs.net');


?>